/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package poker_sim;

import java.awt.image.BufferedImage;
import java.net.URL;

/**
 *
 * @author Rob
 */
public class Deck
{
    URL pkr = this.getClass().getResource("pkr2.png");
    
    BufferedImage CardImages;
    Card[] deck = new Card[52];
    int Size = 52;

    public Deck() 
    {
    }
    
    public Card drawCard()
    {
        Card card;
        if(Size > 0)
        {
            card = deck[Size-1];
            deck[Size-1] = new Card(100,"NOTHING",CardType.DEFAULT, null);
        }
        else
        {
            card = deck[0];
            deck[0] = new Card(100,"NOTHING",CardType.DEFAULT, null);
        }
        Size--;
        return card;
    }
    
    public void Print()
    {
        //System.out.println(Cards.size());
        for(int i = 0 ; i < 52;i++)
        {
            Card selectedCard = deck[i];
            System.out.println("Cardnumber: " + (i + 1) + " " + selectedCard.CardName + " " + selectedCard.Type.TypeName);

        }
    }
    
}
